package com.test;

import org.junit.Test;

import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        Student student = new Student();
        student.setName("小李");
        student.setAge(18);
        student.setStudentNumber(1234);
        student.setGrade(new Grade("软件开发", 8));
        Grade grade = new Grade("软件开发", 20224128);
        student.setGrade(grade);
        student.setDormitoryNumber(501);
        Student student1 = new Student("小刘",
                20,
                4567,
                grade, 501);
        System.out.println(student);
        student.code("IDEA");
        student.classRoomCleaning("C1楼");
        student1.classRoomCleaning("C2楼");
    }

    @Test
    public void test() {
        Grade grade1 = new Grade("软件开发", 20224128);
        Grade grade2 = new Grade("软件开发", 20224129);
        Grade[] grades = {grade1, grade2};
        String[] courses = {"计算机网络基础", "Linux服务器技术"};
        Teacher teacher = new
               Teacher("王老师", 37, courses, grades);
        teacher.code("记事本");
        Student student1 = new Student("小李", 20,
               20241011, grade1, 501);
        Student student2 = new Student("小刘", 20,
                20241012, grade2, 501);
        Student student3 = new Student("小王", 20,
                20241013, grade1, 501);
        student1.playBall();
        student1.code("VsCode");
        student2.classRoomCleaning("信息科学楼");
        student3.dormitoryCleaning();
        Student[] students = {student1, student2, student3};
        /* 数组的每个元素都需要重写toString，每个属性，如果是对象也需要重写toString */
        System.out.println(Arrays.toString(students));
    }
}